﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FrienDev.Data;
using FrienDev.BusinessRules;

public partial class Activity_ActivitySignUp : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["activityid"]))
            {
                int activityID = Convert.ToInt32(Request.QueryString["activityid"]);
                Activity activity = ActivityRules.Instance.GetActivityInfo(activityID);
                if (activity != null)
                {
                    hl_Title.Text= activity.ActivityName;
                    hl_Title.NavigateUrl="~/Activity/detail.aspx?activityId=" + activityID;
                    int curJoinedPeopleCount=ActivityRules.Instance.GetJoinedUserNum(activityID);
                    int SignUpLimit=ActivityRules.Instance.GetActivityInfo(activityID).SignUpLimit;
                    int singleUserSignUpLimit=ActivityRules.Instance.GetActivityInfo(activityID).SingleUserSignUpLimit;
                    lb_Tip.Text = "当前活动已批准报名" + curJoinedPeopleCount + "人，还可报名" + (SignUpLimit - curJoinedPeopleCount) + "人，每位用户限制报名" + singleUserSignUpLimit + "人";
                }
            }
            else
            {
                lb_Title.Text = "erro";
                hl_Title.NavigateUrl = "";
            }
        }
    }
}
